package lxm.demo.ultra;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


public class UltraDemoMainActivity extends AppCompatActivity {


    @BindView(R2.id.btn_ultra_ptrframelayout)
    Button ultraBtn1;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ultra_activity_main);
        ButterKnife.bind(this);
    }

    @OnClick({R2.id.btn_ultra_ptrframelayout, R2.id.btn_ultra_wave_header, R2.id.btn_ultra_store_house})
    public void ptrFrameLayoutClick(View v) {
        String bundleStr = "";
        if(v.getId() == R.id.btn_ultra_wave_header){
            bundleStr = WaveHeaderFragment.class.getName();
        }else if(v.getId() == R.id.btn_ultra_ptrframelayout){
            bundleStr = PtrFrameFragment.class.getName();
        }else if(v.getId() == R.id.btn_ultra_store_house){
            bundleStr = StoreHouseHeaderFragment.class.getName();
        }
        Intent intent = new Intent(UltraDemoMainActivity.this, UltraActivity.class);
        intent.putExtra(UltraActivity.ULTRA_FRAGMENT_CLASS_NAME, bundleStr);
        startActivity(intent);
    }

}
